import { User } from "screens/project-list/search-panel";
import { cleanObject, useDebounce, useMount, queryStr } from "utils";
import { useAsync } from "utils/use-async";
import { useHttp } from "utils/http";


export const useUsers = (param?: Partial<User>) => {
    const client = useHttp();
    const { run, ...result } = useAsync<User[]>();

    useMount(() => {
        run(client("users", { data: cleanObject(param || {}) }));
      }); //相当于 did mount
    return result  
}